cleaning the code a little bit