Refactored the entire script. It updates itself first and then sources out every step of the configuration.