Add code to handle ledger hierarchy - phase 1