Improving the code for better understanding of the project