Extract metadata into its own module