refactor inherit