Where possible, commands should purely depend on their arguments, and not data passed in other ways: this allows them to work properly in key bindings, menus, macros, and be repeated. Because this isn't a TextCommand, macros aren't an argument, but you may want to bind a key to the command in the future.