Put helper function in new utils.js