Refactor eval IF