This feels wrong and dirty, but it works.