If you are matching anyway, I would suggest replacing the if/else by a case. :)