Improved doc generation