workaround for resolving factory callbacks with args passed by reference