fixing issues pointed by sonar