Refactored texture class