Adding some more scoped_locks, some manual unlocking in certain methods + removed some iterators for better readability at the expense of performance.