Make all the library purely functional.