refactor scheduler ops into separate functions