TQA-1588: reorganize scripts and repair them