add consistency check, module-level callable to generate dot