Optimizing HTML Pattern