Gateway added
Refactored activity event states and event states