put filtering logic in main class