refactoring of models; introduced advanced filtering mechanism