if condition parsing improved