Using RDD in an immutable way