Used new factory to reduce code in astbuilder... Still a work in progress