move arg parsing into separate module