Refactored head/dept lock api