I'm not especially happy about having to query the DOM like this. If you have an alternative idea for implementation I'm all ears.