Cleaning and removing dead code