refactored args parser to be recursive