refactored sorting out of event_new.js