Changed internal structure to use more custom classes. Deriving topologies is broken now.