reformat code for texture