Refactored some of the screen bounds handling