#JENKINS-17352 Returned back unit tests, small refactoring