Some changes to the filters
Restructure the code, add some filtering