new flags parser trick
refactor other scripts to use new flags, fixing some issues