Merged creation of some metadata into one function.