Cleaned up the design with some advice from Jay.