use macros to clean up do_ops