extract metadata into its own class