(c) At the hearing before the assigned judge of the circuit court, the validity of the ordinance, including substantiation of the required allegations in the petition, the appropriateness of the location and boundary of the territory to be voted upon for transfer, and other relevant matters shall be considered. All persons residing in the territory to be transferred, all other persons having an interest in the proposed transfer, and the boards of trustees of the involved library districts shall have a reasonable opportunity to be heard upon the subject of the proposed transfer. The judge's determination of the appropriateness of the boundary of the territory proposed to be transferred shall include the following factors: (1) The location of the residents in relationship to the total territory proposed to be transferred.(2) Maintaining the pre-existing non-residential tax bases of both libraries so far as possible.(3) Local traditional traffic, transportation, and marketing routes and the convenience of the residents of the territory proposed to be transferred. The judge, after hearing the statements, evidence, and suggestions of the persons appearing at the hearing, shall determine (i) whether the ordinance is valid and sufficient according to law and (ii) whether the territory to be transferred would receive substantially equal or greater benefits by being transferred. If the transfer ordinance is found to be valid and sufficient, and the territory to be transferred would receive substantially equal or greater benefits by being so transferred, the judge shall enter a final judgement to transfer the territory.