upd: use nested set