Pulled apart the javafx bit and the state machine