Refactor expressions and datatypes