Would it be possible to have a separate script for each state? As it stands right now, the single FSM script can grow very long.