Refactor instance method to class method