Polished states and state manager, now using state manager