SONAR-2501 add preconditions and refactor some method names