remove unnecessary object allocation

Remove 2 unnecessary object allocations (variables are overwritten in the next if/else statement without ever being read).