Rework main scripts.