input args reading logic refactoring