Move meta initialization to its own method and make the bag file creation DRY
Move meta initialization to its own method and make the bag file creation DRY