Added factory object for thread creation.