Fix to_s
Introduced hierarchy types