Switch from inheritance to composition for exceptions