you could define these outside of the `__main__` and pass in the `tag` instead of using the global scope. Defining the method inside a loop seems janky.