Clean up the ir code a bit

Change-Id: I8c302cc1cc1400b9f21e02c31a0ee3b3a4eadc93