This can be move outside of the loop