improve macro