Should be able to drop the depMap here?
(Don't bother rebasing the next commit on top of this if it gets too complicated, I'll be redoing some of it anyway)