refactors location methods into base class; fixes some incorrect type and const declarations