There's some fishy stuff going on here with the delegate stuff and the case statement below, but we can refactor this out on our next wave of improvements.