I would refactor the db query outside the view like you have done with ```get_admin_level_ids_region_ids```. What do you think?