Refactoring code
Moved the util methods into their own module to keep things modularized