Separate tagging logic into classes