This patch simplifies the code to be not three nested matches but rather one match and then some function chaining. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>