Moved around functions from url.js to separate helper file