Rewrote texture handler