For temporary memory usage replace unique_ptr with auto_ptr