I'm a little hesitant to move this into a function until we can guarantee the functions will get inlined. We're already fighting tooth and nail for performance.