Proper inheritance code