improve ordering of nested items