[SPARK-2611] Implementing recommendations

As per
https://github.com/apache/spark/pull/270#issuecomment-46349745