use factory to create parser