Performance enhancements: Caching and updating screen and device variables.