sml: add support for visitor injection