There seems to be some boilerplate in this file. I don't fully grasp the instantiation logic here so I can't suggest a simpler solution yet, but I thought I'd mention it. :)