simplify method check condition