ad process.cwd, code cleanup