This would be cleaner if it used data attributes.