Connected textures code cleanup