Fixes DEVELOPER-219

One commit moves things around, the other finishes the implementation. Can squash if needed.