Move ERB rendering into its own method.