use unique_ptr for block