Refactored some code in the performance DAO