Reorder operations in persistCardSet
Use takeWhile instead of regex in replaceThis