Change if-then-else to guards.