Collect script update, code cleanup