diff --git a/rst2ansi/ansi.py b/rst2ansi/ansi.py
index <HASH>..<HASH> 100644
--- a/rst2ansi/ansi.py
+++ b/rst2ansi/ansi.py
@@ -208,7 +208,7 @@ class ANSITranslator(nodes.NodeVisitor):
   def visit_document(self, node):
     self.push_ctx()
 
-  def depart_document(self, node):
+  def _print_references(self):
     self.push_style(styles = ['bold'])
     self.append('References:')
     self.pop_style()
@@ -225,6 +225,8 @@ class ANSITranslator(nodes.NodeVisitor):
     self.references = []
     self.pop_ctx()
 
+  def depart_document(self, node):
+    self._print_references()
     self.depart_section(node)
 
     self.pop_ctx()
Refactored reference list into its own function