add middle interface for per thread use