refactor out some duplication/complexity in EventLoader