Stuff is currently queried multiple times in various drivers. Let's just move all of this to common code.