Refactor eval code.