refactoring for inheritance drill