Add filter method to object and hash