Eliminate duplication in humble_editor/api