Moved functions to class.