WIP: refactor location support.