refactor locations.js.coffee