reorged libgrok code since it annoyed perry