Refactored issues from sonar check