implementation refactor. and the resulting test updates.