Extract getHyperlinks method from removeHyperlink method