refactored model inhertiance