Refactoring for schedule table