refactor location