sonar issues & refactoring