factor out schema parsing into its own module