refactoring work with textures, prepared logic for theming;