add some tests. fix sonar major issues