Changed class method to instance method