better database queries, no duplicate events