Thread task and minor updates.

using async task to do some processor intensive tasks - and other improvements.