优化控制逻辑

optimizing control logic