Changed API - now all function accepts assertion function