removing functor over state machine for refactoring