refactored to add class methods