code cleanup and fix the bug where filters dont get reset when you go back to initial state