Simplify test loop script