reducing number of locks