Refactoring the evaluation code.