- some cosmetic changes (typos, unused vars, private utils constructor...)
- wrapped lock into try/finally statement