this is subjective. some people consider assignment within an if expression an "anti-pattern", but yeah, i think its better as well.