Remove duplicate code
Fix whitespace and formatting
Enable Travis CI build