Moved filter functions to a new file