SONARJAVA-197 Update according to feedback, and improve implementation