bench script refactor