Refactoring to class.