hybrid lock refactored to be a class