Use a for loop instead of a context manager