Add class for state machine
Start using state machine to manage interaction