just marking this as something to look back to. (so much code in this change!)