merge periphery code