100% code coverage

Moved this to utils to make testing it easier.