Remove this patch, this logic should be moved to plugins