Refactoring Thread methods into controller.