more syntax cleaning. better typechecking