Moved pointer display control to a method.