Other than that, @igorp is right; you could alternatively use lookups to retrieve your four fields as it does look like they are all available as search columns.
Functionally your
if-else
blocks look fine; personally I'd probably restructure things a bit but I'm pretty obsessed with removing as many