refactored inheritance