PIM-2840: Clean code when remove a category

| Q                    | A
| -------------------- | ---
| Bug fix?             | N
| New feature?         | N
| BC breaks?           | N
| CI currently passes? | Y
| Tests pass?          | Y
| Scenarios pass?      | ?
| Checkstyle issues?   | N
| Changelog updated?   | N
| Fixed tickets        | PIM-2840
| Doc PR               |