used event-based model for dom updates