Add loop script, clean deprecated files