improve argument parsing
reorganization