simplify pattern handling