location refactor