folding parser into factory, better organization
moving import to the top