Refactor to handle jenkins issue