State Machine improvements