Got rid of TYPE and ID nonsense- instanceof works better