Modify funcs with grains in pillar.