travis tests and code optimizations