refactored as a class method