Move code to script.