refactor(scripts): refactoring sync and exist lines