Refactor schedule