Restructuring & optimizations