added some comments and separated options parsing to its own object