[CLEANUP] Replace deeply nested if structures by guard clauses