fixed several sonar violations and improved javadoc