code re factor. enhancement for filter.