Extract resource registration into its own class.