small file restrusture, adding command line interface