Added thread and some helper modules