refactored command argument parsing