[FEATURE][WIP] Refactored locking

Change-Id: I6ce6270aa22f9d467da2df0bfaaeadfa9b05b8c4