Refactors, fixes some specs, and greens some specs.