Refactor global domain event handler and add a feature spec