Spark utilities