Cleaned up IR by using unsafe indexing