Move the ltidb stuff into a class