small cleaning and several modifications