Ported macros from TS hyper-demo