refactoring pruning