unique_ptrs for allocation simplification