Code refactoring to allow performance evaluation for multiple functions