Cleaning up the code2