Refactoring of argparsing