refactored utils class