Remove util function and replace with npm package