improve command line options
eliminate dead code