kind of hackish seperation of lib and cli