DRY up function/text handling function
Update package.json