Reimplemented stylus caching