First stab at turning this into a framework.