Refactor travis script