ws
refactor hierarchy builder
improve labelling of hierarchy