refactor locations to remove a bit of redundancy

Note: I haven't extensively tested this (aside from `rake spec`, which passed). Please look this over carefully before merging.