added support for tag route and query. also some minor code smell edits