update code to use ImmutableArray.Builder