Created final piece to the puzzle - state machine builder