Finite-state machine Builder