Refactored code (partially). Updated filters.