Improve sync script