Refactored travis script