Move hardware locking features to separate function