refactoring + added filtering param min-max-slope