move code in a class, parse command line arguments