Better cursor management