restruct scripts, prepare for buttons