refactoring to jenkins api