Callback mechanism for algorithms