Added comment to metadata function to make it clear it's ugly and may change :)