Travis script refactoring