Removing unused code and updating debug