pprint cleanup and docgen instance caching