Refactor to class.