I'm still seeing two copies of this block of code.  I agree it makes sense to avoid having Document depend on ProjectManager, but it could still be wrapped into a shared helper function within DocumentCommandHandlers...