optimize , remove unnecessary attribute detecting in rock function