Move magicalize_{isa,overload} out into functions