Simplify some typing and env code.