Changed validations and relocated helper methods from controller to ApplicationHelper