refactoring for gitbook