migrating label-specific code to avoid overwrite