refactor location calls