Refactor loadActivity in schedule_view.js