remove unnecessary references
added processing of metadata