Added the refined layout and script handling.