add utility method and unit test