Little code clean up
This copy is before starting with state machine