compile the pattern just once and remove simple objects