As mentioned above, this should be refactored out.