Refactored 2D utility classes