Refactored Project state_machine