Refactoring and adding another utility function test.