Optimized the init code.