Move helper methods to top of file.