Refactored some code
Added travis-ci build