Fixing recent changes + small refactor
Fixing makeTreeSchema method
Fixing nesting mistake