clean up use of function types in the AST