Update: Organize the validate operation into separate type functions and improve error handling logic.
Move the contents of each validate operation if condition block into separate functions.
This makes the validate operation code more consistent with how the process operation code.
This simplifies some of the nesting.
This has a cost of adding and calling more functions.
Multi-purpose functions are used where applicable rather than having a single function for each operation type.
The error handling is improved in some cases where errors are printed for all arguments rather than the first.
This is done only in cases where I could obviously and quickly determine that this can be done.
There is the possibility of mistakes or regressions due to the structural changes and the condition block changes.