Re-refactor. Two tests failing.