improve the readability of SparkContext.scala