abstract capture function as a class