add factory to event listener functions