You could tighten up the if else here to avoid some nanoscale duplication