some additional logic to keep the use of memory in Texture low