Moved some things around to be more self-contained and modular.
If you disagree with this let me know, it just seemed fitting in my head to move this stuff to a contained Util. More modular and reduces the scattered code.