isolate the interesting part in lib/slave