More refactoring of texture mapping code