Refactoring according to sonar report