Added high-scale-lib dependency.
Use thread-local variables to save unnecessary object initialization.