Refactor thread and comments