Move location lookup logic out of controller

This will make it easier to test and to add the lookup by local
authority functionality