Add capture function as utility.