Apply latest code quality advice from sonar 3.5.1