Preparation scripts code improvements (3)