Whenever, in the opinion of a majority of the members of the county legislative body, two thirds (2/3) of them being present, the site of a jail or public prison, or courthouse, is unhealthy, insecure or inconvenient in its location to the county or to the town, or inhabitants of the town, in which it is situated, or the interest and convenience of the town would be promoted by the removal of any of the same, the members may order a sale of the site, and of the whole or part of the materials used in its construction; and they may also order that a more eligible, convenient, healthy or secure site be purchased, and cause to be erected thereon a new jail or courthouse, better suited to the convenience of the town, and to secure the safe custody, health and comfort of inmates.