Moved functions into their own files.