cleanup and add long options