PMD : fix cyclomatic complexity