Remove and consolidate various uses of reflection.