Removed code duplication of filtering by introducing filtering_module