More progress with tests and decoupling