you don't need to null check because it is dead code now with using instanceof