Refactored get_filters into a generalized method so I can use it
elsewhere.