Refactoring, work in progress
Map and location delete bugfixes