improved argument parsing