Improve API design. Make callback function can get current context scope.