try some ideas with state machine style files