Sorry my point was more that by doing the cast to array you can skip the whole if/else block and also avoid the duplication you introduced now. I wasn't suggesting that duplicating is cleaner ;)