possibly less tangled code with macro