Generate metadata items only once

The metadata items were generated twice in rapid succession, generating unnecessary overhead. Solved that.