refactoring for proxymodels