Use unique_ptr for character data ownership