refactor common functions into base

ensure tag retrieved from async-tag-query is the same name as the
desired tag