OS scheduler code cleanup