refactor location dispatch