cleaning the data structures