Refactor throughput_benchmark