moving all logging to threads