Optimized the code structures.