change architecture from inheritance to composition