mapposition instead of location, refactoring