Locations refactoring

Squashed by accident