change the pattern of smart pointer usage