Refactored some code and added travis badge