Made hierarchy more general.