refactor benchmark method