initial refactor for scheduler