Refactor MockEventReceiver to templates.