Slightly refactored argument parsing