refactor of inheritance