Refactored how filters are built to be in a more functional style