Refactored texture splitting code to new class