refactorings as suggested of sonar