refactor enrichment process to ensure that input arguments are not altered