refactor code to use a single thread only
upper case comment start