Doing terrible things with reflection so you don't have to