refactor reverse query
Merge pull request #15 from pelias/refactor_reverse

refactor reverse query