Migrated common code.