Remove initialized variable
Some cleanup and an extra logging statement.
More thread-safe