Rewrite Contribution to use inheritance instead of generics