Removed reference counting with shared_ptr