parsing arguments moved out from main script