refactors a methods in the timetable controller