Refactor get_wiki things to remove duplication