- refactoring texture related code