Refactored inverse mapping of quads