Refactoring for using with travis-ci