Deferred: refactoring and more tests passing