Refactor handling of models, DOM highlighting