refactoring: renamed field
refactoring: extracted methods for locking and unlocking the queue