refactoring: common functions createTagsObject and addInfo