`retrieve_tmp_doc` is only called by `tmp_doc` which is only called in `push_design_start` to check if the temporary doc exists or not, so you don't actually have to waste time parsing the doc, and maybe all these methods should have their names changed.