cleaned memoize a bit more.