Code cleanup
The lock object should be readonly