There should be a better way to do this.