[task] refactoring code through suggestions from SONAR