Cleaning the code so that it's as clean as I can get it