closer to spec, plus some more simplification