refactored with trs method and use of benchmark gem