Simplified some reflection code.