In situ and ex situ treatment