refactor filter check on tp condition