Refactor constant eval a little bit