JC: minor refectoring. spec passes.
JC: spec passes.