finite state machine
entity implement