Adding tests and abstracting transport