Minor refactorings following the last commit for KMeans

Refactored the common function into a Functions util class. 
This is just a bit of preference, but I don't like static imports except in very particular circumstances. I'd just use `Functions.PARSE_FN` in the code. Otherwise I go searching for `PARSE_FN` in the file.