some cleaning of the code