split create hierarchie function in 3 subfunctions
some code cleaning
Merge pull request #2 from Panfloss/cleaning

Cleaning