reworked dependency ordering