some refactoring of argparser code