[SPARK-3611] Naming and formatting changes made from comments of PR 2980