Split the main scripts in 4 sub-scripts