Optimized some code

no new feature