more changes to conform to sonar results