put lockd code into a class