[SPARK-1766] sorted functions to meet pedantic requirements

Pedantry is underrated