create object to hold frame stats and refactor