some refactor and add schedules