Refactor debug tagging logic into functions