Refactored to class.