Completely rewrite the inheritance system