Refactored parsing of arguments