Refactory directory filter.