Refactor the code
Add travis stuff