StartThread functionality is removed. Some code improvements related to perfomance and design.