I think you can call the prepare outside the loop?