Transfer arg parsing in separate function