Split functions and format code to be code sniff compliant.