simplify condition check