pruning unused code and simplifing existing code