Tidying up pointer detection