allow duplicate options
change default num_threds
enable debug flag
refactor