优化逻辑