Moving functions to more appropriate files.