Part1 cleaning up the code