implementation of a filter for the theories
refactoring