some cleaning and fixing