Cleanup, renamed some functions, fixed data member order in TriggeredRUle