Refactored and fixed geographic view queries