[xhuang]: refactor code, use thread to manage content.