Hacking around to make this easier to integrate into other applications.