I think I searched a lot for a cleaner way to do this, but found none. If anyone has an idea, I'd love to hear it.