minor redesign, starting test-driven