Refactoring and revised test specs.