Preparation scripts code improvements (2)