fix: PMD Cyclomatic complexity