Improve menu scripting