wrapIt and wrapExpect functions are secured against multiple calls and slightly simplified