use heap-allocated blocks to pass data to callbacks
prefer to assign to return value field in callees rather in callers