Simplify some reflection code.