Moved the filtering code to the table class.