Currently the optimizer needs to read the AST 2*n times if it has n different optimizations to perform, which is highly inefficient. We should be able to read the AST at most 2 times to perform all the optimizations.