Refactor "only-once" setup stuff into it's own private method.

Incremental changes. Don't uncomment the new code yet.