It's a shame we need these conditionals. Would be nice to refactor them away at some point.