#81 cleanup thread variables a bit