Parameterizing thread count and improving logging