Refactoring and pruning files