refactor to start taking into account unscheduled tasks