Changed validations to newer syntax and moved to the top

Refactored validations to new syntax and moved to the top.