I know this is a silly question but I need to know if I am doing this right. I am using firebase firestore database to store data of properties which is sorted and filters in my Android app. The user can filter those properties according to areas i.e. if he selects a specific area then properties of those areas only will be listed and if he chooses 'all' then all properties will be listed. I am achieving this logic via the following code:- 

```
private void updateListViewOldest(String city, String area, Long type) {
   final ArrayList<PropertyListObject> objects = new ArrayList<>();
    FirebaseFirestore db = FirebaseFirestore.getInstance();

    if (area.equals("All")) {
        db.collection("Properties")
                .orderBy("postTime", Query.Direction.ASCENDING)
                .whereEqualTo("city", city)
                .whereEqualTo("type", type)
                .get()
                .addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
                    @Override
                    public void onComplete(@NonNull Task<QuerySnapshot> task) {
                        if (task.isSuccessful()) {
                            for (QueryDocumentSnapshot document : task.getResult()) {
                                propertyListPosition.add(document.getId());
                                PropertyFetchObject pfo = document.toObject(PropertyFetchObject.class);

                                objects.add(new PropertyListObject(pfo.getPrice(), pfo.getName(), pfo.getArea(), pfo.getSize(), getTime(pfo.getPostTime()), pfo.getCity()));
                            }

                            PropertiesListAdapter propertyAdapter = new PropertiesListAdapter(PropertyAds.this, objects);
                            adsListView.setAdapter(propertyAdapter);

                        } else {

                            Toast.makeText(PropertyAds.this, "error: " + task.getException().getMessage(), Toast.LENGTH_SHORT).show();
                                                        }
                    }
                });
    } else {
        db.collection("Properties")
                .orderBy("postTime", Query.Direction.ASCENDING)
                .whereEqualTo("city", city)
                .whereEqualTo("type", type)
                .whereEqualTo("area", area) // just added this
                .get()
                .addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
                    @Override
                    public void onComplete(@NonNull Task<QuerySnapshot> task) {
                        if (task.isSuccessful()) {
                            for (QueryDocumentSnapshot document : task.getResult()) {
                                propertyListPosition.add(document.getId());
                                PropertyFetchObject pfo = document.toObject(PropertyFetchObject.class);

                                objects.add(new PropertyListObject(pfo.getPrice(), pfo.getName(), pfo.getArea(), pfo.getSize(), getTime(pfo.getPostTime()), pfo.getCity()));
                            }

                            PropertiesListAdapter propertyAdapter = new PropertiesListAdapter(PropertyAds.this, objects);
                            adsListView.setAdapter(propertyAdapter);

                        } else {

                            Toast.makeText(PropertyAds.this, "error: " + task.getException().getMessage(), Toast.LENGTH_SHORT).show();
                                                        }
                    }
                });
    }
}

```

Is writing whole code again just for the line

> 
> .whereEqualTo("area", area)
> 
> 
> 

is right? Or there is a smarter way to do this?