Parse command line arguments with OptionParser; Refactor