WIP Bug1093214

This callback is doing several different things. Can we break each of the tasks down into focused testable functions?