Also, I would move both of these into the spark.scheduler package