Use class method instead of function