bug fixes, organizational changes, multi-threading issue fix