insert markup and state to the models.