Cleanup and documentation for event/state transition table