libgen.js and cleanup