Refactored geometry portion of Frag.