Refactoring into class.