Refactoring handler to support validations