unify the Expect function into one.