refactor validations
working state machine