More code cleanup and texture work