thread enabling and restructure