make fromFile return a smart pointer