Some refactoring, plus a couple of concrete shapes (Sphere and Capsule).