refactor screen/cursor functions.