Functional refactoring of SqlTypes