clean up the code little bit