optimized the code structure
optimized the code structure