PIM-3086: Clean some code

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