Use unique_ptr and memory rules