same some calls to fs.existsSync, which is quite slow