Refactoring and add predictate

Refactoring and add predictate