improve invoke method allowing callback and subscriptions