more work on simplifying fsm construction
fixed tests
reduced visibility