Add reading command line option and modify the initialization to sync with new API