Code optimization
Improvement and bug fixes