Refactor on render in schedule_view.js