DRYing main() a bit.