some small cleaning of code