Moved filter into named function.