improved prepare scripts