Replaced thread with threadfactory