refactored utils, and made it module like