Preparation scripts code improvements (4)