some cleaning and fixes