refactored class into stand-alone library