Updated with util and unit tests