refactoring azkaban code