Move some reflection things to a separate type