Refactored to match Jenkins CI