Cleanup and additional a more conservative locking strategy