Added utility methods and tests.