Some refactoring to please SonarQube