Using Smart Macros to Optimize User Actions on Smartphones