[JENKINS-24475] and refactoring