Refactored validate into a command file