First cut at refactoring UnlockRuntime
Minor refactorings of UnlockFactory