refactor the tags methods for #26 and #36