Refactored, test stubs in place.