fixing Sonar's FindBugs Major issues