Refactored how command line arguments are handled