Refactoring + test infrastructure.