fixed sonar issues. added documentation