refactorings as suggested by sonar