default threads to 1
refactor