implement state machine with functions list