moving util out of main lib to remove node dependency