re-order & correct dependencies

Change-Id: I5890553bcbdf9af5533b42483358bbf55f27485a