refactor model inheritance