Refactor Filtering using ActiveSupport.