Simplify pattern ID handling.