Prepare metadata