Any building or portion thereof declared unsafe or unsanitary by a proper authority may be restored to a safe or sanitary condition.