replaced filteredData with data and data with a private pristineData, other minor refactoring