refactored. filtering and defineFilter API changed. adopted to "injects"