Move version out of the loop