Yeah i didn't really look at the outer structure. Now I think it's better to merge all the error handlings to the same place, and yes there's no need for the separation of main() and tool() anymore, totally unnecessary.