Better dependency tracking

It's still hecka hacky