Model class refactored, ScopedLock added.