refactor for threading

Tidy up the spacing.