reorganized optimization passes