Moving out state_machine from Build model