Model builder using smart pointer