basic improvement of code