Refactor the Travis script.