Convert from id to instancetype