Removed some of the "normal" pointers and replaced them by smart pointer to prevent memory problems