Refactor benchmark utility as a framework