Added validator to list of variable declarations.
Removed unnecessary conditional.
Refactored a conditional to be more explicit.
Changed all function applys to calls since there is an explicit number of arguments.