add memory management via using unique_ptr