library shuffling for grd5/grd3 common code extraction