Why not make this a top-level class instead of a nested class in SparkEnv?