if-then-else cleaned