Refactor travis CI script.