SONAR-5388 Some refactoring