Optimize transformation