can you avoid nested if condition ?