No need to use `instanceof` in frequent operations too, just `if (magnetPoint)` will do.