ci scripts refactoring