move chinese pid code to a gem