refactored class for usability