* Move utils out
* Some minor refactoring