Refine JS that automatically updates events on homepage