Refactoring of Evaluation function.