Fix subclassing issue by duplicating code