Improvement of code