This looks like a huge hack. There has to be another way.