Slight refactoring to test helper methods around setting up metadata