texture hook refactored to own class