adding travis config and some minor refactoring.