Extract `Locker`.

Closes #378.