this function should live in the helpers.js file so we can use it everywhere.