Refactor inheritance