Updated to use smart pointers and simplify parser subclassing