refactoring metrics + threaded client