refactoring texture