implemented unique_ptr to avoid boost.