adding remove match action with tests and before filter; some refactorings