Refactor some behavior out of travis run