Reorganized whole application script structure.