improvement of the code