Moved functions into class file.