Pruning unnecessary codes