minor code cleanup and few tweaks (thread parser