cleaned up event handler module