making location more modular
seperating logic in location.js