JENKINS-21037: reformatted, refactored instance check