PIM-3415: Split methods to decrease the cyclomatic complexity value

| Q                    | A
| -------------------- | ---
| Bug fix?             | No
| New feature?         | No
| BC breaks?           | No
| CI currently passes? | Yes
| Tests pass?          | Running
| Scenarios pass?      | Running
| Checkstyle issues?*  | No
| PMD issues?**        | No
| Changelog updated?   | No
| Fixed tickets        | -
| DB schema updated?   | No
| Migration script?    | No
| Doc PR               | No