improved memoizer support, cleanup