refactor benchmark loops for clarity