This would be good pulled out into a separate file so it can be passed through the bundler for minification.