Refactor arguments tagging into a function