State machine draft