Refactored parts of getLocationId() body. It now uses more compact method calls.