Refactor benchmark script