Improving structures of scripts