Rewrite/Restructure fragments

Rewrite fragments of common types to inherit from base classes