[SPARK-4409] Fourth pass of code review