refactor store and extract input file argument
fix file input when binary