Cleaning up code in preparation for extra safety!
Making window methods a little safer.