cleaning some of the code