Merge utils.js code to repo